package com.nanhai.buddhist.college.module.collegebase.dal.mysql.rollchecklog;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.rollchecklog.vo.RollCheckLogExportReqVO;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.rollchecklog.vo.RollCheckLogPageReqVO;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.rollchecklog.RollCheckLogDO;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.studentchange.StudentChangeDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.rollchecklog.vo.*;

/**
 * 学籍信息审核记录 Mapper
 *
 * @author AKai
 */
@Mapper
public interface RollCheckLogMapper extends BaseMapperX<RollCheckLogDO> {

    default PageResult<RollCheckLogDO> selectPage(RollCheckLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RollCheckLogDO>()
                .eqIfPresent(RollCheckLogDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(RollCheckLogDO::getOldStatus, reqVO.getOldStatus())
                .eqIfPresent(RollCheckLogDO::getNewStatus, reqVO.getNewStatus())
                .eqIfPresent(RollCheckLogDO::getCheckUser, reqVO.getCheckUser())
                .eqIfPresent(RollCheckLogDO::getCheckTime, reqVO.getCheckTime())
                .likeIfPresent(RollCheckLogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(RollCheckLogDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(RollCheckLogDO::getCheckTime, reqVO.getCheckTime())
                .orderByDesc(RollCheckLogDO::getCreateTime));
    }

    default List<RollCheckLogDO> selectList(RollCheckLogExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<RollCheckLogDO>()
                .eqIfPresent(RollCheckLogDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(RollCheckLogDO::getOldStatus, reqVO.getOldStatus())
                .eqIfPresent(RollCheckLogDO::getNewStatus, reqVO.getNewStatus())
                .eqIfPresent(RollCheckLogDO::getCheckUser, reqVO.getCheckUser())
                .eqIfPresent(RollCheckLogDO::getCheckTime, reqVO.getCheckTime())
                .likeIfPresent(RollCheckLogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(RollCheckLogDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(RollCheckLogDO::getCheckTime, reqVO.getCheckTime())
                .orderByDesc(RollCheckLogDO::getCreateTime));
    }

}
